﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WuxiWTO.Mapping;
using WutiWTO.Common;

namespace WuxiWTO.Web.UserControl
{
    public partial class hotNews : System.Web.UI.UserControl
    {
        WTODataContext ctx = new WTODataContext();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GetHotNews();
            }
        }
        private void GetHotNews()
        {
            var news = (from c in ctx.articles orderby c.read_count descending, c.update_date descending select c).Take(6);
            this.rptHotNews.DataSource = news.ToList();
            this.rptHotNews.DataBind();
        }
    }
}